package com.example.demo1115.swagger;

import com.google.common.base.Predicates;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.service.VendorExtension;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

import java.util.ArrayList;


@Configuration
public class SwaggerConfig {
    @Bean
    public Docket docket(){
        Docket docket = new Docket(DocumentationType.SWAGGER_2)
                .groupName("樊博士")
                .apiInfo(getInfo())
                .select()
                .apis(RequestHandlerSelectors.basePackage("com.example.demo1115.controller"))
                .build()
                ;

        return docket;
    }
    private ApiInfo getInfo(){
        Contact DEFAULT_CONTACT = new Contact("樊博士", "www.baidu.com", "1374511562@qq.com");
        ApiInfo info = new ApiInfo("在线预约API", "在线预约API", "2.0", "http://www.baidu.com",
                DEFAULT_CONTACT, "测试", "test", new ArrayList<VendorExtension>());
        return info;
    }


}
